<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<jsp:include page="common/simple_header.jsp">
    <jsp:param name="title" value="用户注册"/>
    <jsp:param name="customCss" value="register"/>
</jsp:include>

<div class="container">
    <h3>用户注册</h3>

    <div class="error-message" id="error-message"></div>
    <div class="success-message" id="success-message"></div>

    <form id="registerForm" method="post">
        <div class="form-group">
            <label for="uname">用户名：</label>
            <input type="text" id="uname" name="uname" placeholder="请输入用户名" autocomplete="username">
            <div class="error-text"></div>
        </div>

        <div class="form-group">
            <label for="pwd">密码：</label>
            <input type="password" id="pwd" name="pwd" placeholder="请输入密码" autocomplete="new-password">
            <div class="error-text"></div>
        </div>

        <div class="form-group">
            <label for="cpwd">确认密码：</label>
            <input type="password" id="cpwd" name="cpwd" placeholder="请确认密码" autocomplete="new-password">
            <div class="error-text"></div>
        </div>

        <div class="form-actions">
            <button type="submit" class="btn btn-primary" id="submitBtn">注册</button>
            <button type="reset" class="btn btn-secondary">重置</button>
        </div>
    </form>

    <div class="login-link">
        <p>已有账号？<a href="${pageContext.request.contextPath}/toLoginServlet">立即登录</a></p>
    </div>
</div>

<jsp:include page="common/footer.jsp">
    <jsp:param name="customJs" value="register"/>
</jsp:include>
